package cn.itcast.netty.nio.c4;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

/**
 * className: Client
 * description:
 * date: 2024/6/6-8:28
 * <p>
 * project: netty-demo
 * package: cn.itcast.netty.nio.c4
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
public class Client {

    public static void main(String[] args) throws IOException {
        SocketChannel sc = SocketChannel.open();
        sc.connect(new InetSocketAddress("localhost", 8080));
        SocketAddress address = sc.getLocalAddress();
        sc.write(Charset.defaultCharset().encode("0123456789abcdef0123456789abcdef3333\n"));
        System.in.read();
    }
}
